package com.ruoyi.process.pipemaintainence2.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.process.pipemaintainence2.mapper.TBpmnApprovalMapper;
import com.ruoyi.process.pipemaintainence2.domain.TBpmnApproval;
import com.ruoyi.process.pipemaintainence2.service.ITBpmnApprovalService;
import com.ruoyi.common.core.text.Convert;

/**
 * 审批意见Service业务层处理
 *
 * @author Xianlu Tech
 * @date 2019-12-05
 */
@Service
public class TBpmnApprovalServiceImpl implements ITBpmnApprovalService {
    @Autowired
    private TBpmnApprovalMapper tBpmnApprovalMapper;

    /**
     * 查询审批意见
     *
     * @param id 审批意见ID
     * @return 审批意见
     */
    @Override
    public TBpmnApproval selectTBpmnApprovalById(String id) {
        return tBpmnApprovalMapper.selectTBpmnApprovalById(id);
    }

    /**
     * 查询审批意见列表
     *
     * @param tBpmnApproval 审批意见
     * @return 审批意见
     */
    @Override
    public List<TBpmnApproval> selectTBpmnApprovalList(TBpmnApproval tBpmnApproval) {
        return tBpmnApprovalMapper.selectTBpmnApprovalList(tBpmnApproval);
    }

    /**
     * 新增审批意见
     *
     * @param tBpmnApproval 审批意见
     * @return 结果
     */
    @Override
    public int insertTBpmnApproval(TBpmnApproval tBpmnApproval) {
        tBpmnApproval.setCreateTime(DateUtils.getNowDate());
        return tBpmnApprovalMapper.insertTBpmnApproval(tBpmnApproval);
    }

    /**
     * 修改审批意见
     *
     * @param tBpmnApproval 审批意见
     * @return 结果
     */
    @Override
    public int updateTBpmnApproval(TBpmnApproval tBpmnApproval) {
        tBpmnApproval.setUpdateTime(DateUtils.getNowDate());
        return tBpmnApprovalMapper.updateTBpmnApproval(tBpmnApproval);
    }

    /**
     * 删除审批意见对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTBpmnApprovalByIds(String ids) {
        return tBpmnApprovalMapper.deleteTBpmnApprovalByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除审批意见信息
     *
     * @param id 审批意见ID
     * @return 结果
     */
    @Override
    public int deleteTBpmnApprovalById(String id) {
        return tBpmnApprovalMapper.deleteTBpmnApprovalById(id);
    }
}
